<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
		<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
		<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
		<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>

<script type="text/javascript" src="<%=basePath%>Js/jquery.js"></script>
<link rel="stylesheet" type="text/css" href="<%=basePath%>css/mycss/bootstrap.min.css" />
</head>

<script type="text/javascript">
//修改密码
function updateStafpassword(){
	
	var password1 = $("#password1").val();
	var password2 = $("#password2").val();
	var password3 = $("#password3").val();
	
	if(password2 != password3){
		alert("前后密码不一致")
	}else{
		$.ajax({
			type:"post",
			url:"updateStafpassword.do",
			data:{
				"password1":password1,
				"password3":password3,
			},
			dataType:"text",
			success:function(result){
				if(result == "1"){
					alert("修改成功")
				}else if(result == "2"){
					alert("原密码错误")
				}else{
					alert("修改失败")
				}
				
			},
			error:function(){
				alert("系统故障")
			}
		})	
	}	
}

</script>

<body>
<hr><h3 align="center">个人中心</h3><hr><br>

<div style="position: absolute; left: 300px; top: 120px; width: 700px; height: 10px">
	<table class="table table-bordered">
	
		<tr>
			<td>员工编号</td>
			<td>${staflist.number}</td>
		</tr>
		<tr>
			<td>密码</td>
			<td><a href="" data-toggle="modal" data-target="#myModal">修改密码</a></td>
		</tr>
		<tr>
			<td>姓名</td>
			<td>${staflist.name}</td>
		</tr>
		<tr>
			<td>身份证号码</td>
			<td>${staflist.idnumber}</td>
		</tr>
		<tr>
			<td>居住地址</td>
			<td>${staflist.address}</td>
		</tr>
		<tr>
			<td>职称</td>
			<td>${staflist.jobtitle}</td>
		</tr>
		<tr>
			<td>性别</td>
			<td>${staflist.gender}</td>
		</tr>
		<tr>
			<td>年龄</td>
			<td>${staflist.age}</td>
		</tr>
		<tr>
			<td>权限</td>
			<td>${staflist.jurisdiction}</td>
		</tr>
		<tr>
			<td>班次</td>
			<td>${staflist.worktime}</td>
		</tr>
		<tr>
			<td>入职时间</td>
			<td>${staflist.reserved1}</td>
		</tr>
		<tr>
			<td>联系电话</td>
			<td>${staflist.phone}</td>
		</tr>
		<tr>
			<td>备注</td>
			<td>${staflist.remarks}</td>
		</tr>
		
	</table>
	</div>
	
	<!-- 详细信息模态框（Modal） -->
		<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
							&times;
						</button>
						<h3 class="modal-title" id="myModalLabel" align="center">
							密码修改
						</h3>
					</div>
					<div class="modal-body" >
					<table class="table table-bordered">
						<tr>
							<td>原密码</td>
							<td> <input type="password" class="form-control" id="password1" placeholder="请输入原密码"></td>
						</tr>
						<tr>
							<td>新密码</td>
							<td> <input type="password" class="form-control" id="password2" placeholder="请输入新密码"></td>
						</tr>
						<tr>
							<td>确认密码</td>
							<td> <input type="password" class="form-control" id="password3" placeholder="确认密码"></td>
						</tr>
						<tr>
							<td colspan="2"><button type="button" class="btn btn-success" onclick="updateStafpassword()">修改</button></td>
							
						</tr>
					</table>
				</div>
				
				</div><!-- /.modal-content -->
			</div><!-- /.modal -->
		</div>
</body>
</html>